#!/bin/bash
file_name=functions.sh
funcs=`which $file_name`
if [ "$funcs" != "" ] ;then
  echo "funcs=$funcs"
  . $funcs
else
  funcs=`dirname $0`/$file_name
  echo "$PWD"
  echo "funcs=$funcs"
  if [ "$funcs" != "" ] ;then
    . $funcs
  else
    exit
  fi
fi

compiler_ip=`mount|grep workspace |tr '/' ' '|awk '{print $1}' |awk -F'.' '{print $4}'`

echoTextBlue  "----------------本地目录-------------------"
echoTextGreen "cd ~/workspace/gphone/MT6577/PD1211W/
cd ~/workspace/gphone/MT6575/PD1203/
cd ~/workspace/gphone/MT6573/PD1110/
"
echoTextBlue  "----------------挂载目录-------------------"
echoTextGreen "cd /mnt/$compiler_ip/workspace/gphone/MT6577/PD1211W/
cd /mnt/$compiler_ip/workspace/gphone/MT6575/PD1203/
cd /mnt/$compiler_ip/workspace/gphone/MT6573/PD1110/
cd /mnt/$compiler_ip/workspace/gphone/release  编译服务上存放编译结果的目录
cd /mnt/smartsvn/smb/upgrade  升级包备份目录
"
echoTextBlue  "----------------常用命令-------------------"
echoTextGreen "./makeMtk -o=TARGET_BUILD_VARIANT=user  bbk75_cu_ics new 编译user版本
autopack.sh -m mannul  -d bbk75_cu_ics -p PD1203  手动打包软件
svn-update.sh --url http://smartphone/repositories/AppsOfMtk/trunk/packages-w1140/ packages -p PD1203
smart.shc -m [ssh|telnet]  zhangfeilong    ssh登录到张飞龙所在的组服务器
smart.shc -m mount         smartupgrade    挂载smartupgrade服务器的共享目录
mount.sh compiler002,smartupgrade          同时挂载服务器:compiler002,smartupgrade的共享目录
sudo mount -t nfs 172.20.127.15:/home/shared /mnt/smartftp/nfs/shared
sudo curlftpfs -o rw,iocharset=utf8,user=upgrade:xxx,uid=\$USER,gid=\$USER,allow_other,nonempty ftp://\$smartupgrade_ip/upgrade /mnt/smartsvn/ftp/upgrade
sudo mount -t smbfs -o rw,iocharset=utf8,username=\$compiler002_user,password=\$compiler002_pwd,uid=\$USER,gid=\$USER //\$compiler002_ip/workspace /mnt/250/workspace
sshpass -p \$compiler002_pwd  scp  -r  sudo.shc  compiler@\$compiler002_ip:/usr/local/bin/
sshpass -p \$compiler002_pwd  ssh               compiler@\$compiler002_ip  ls /usr/local/bin/sudo.shc -ls
sshpass -p \$compiler002_pwd  ssh               compiler@\$compiler002_ip  sudo -S chmod +s /usr/local/bin/sudo.shc 
shell-remote.sh --config ~/svn/svn-scripts/configs/smart.ini \"sudo svn up /usr/local/bin/ \$my_svn_options_up\"   在所有服务器上远程执行命令
shell-remote.sh --config ~/svn/svn-scripts/configs/smart.ini --machine \$machines \"sudo svn up /usr/local/bin/ \$my_svn_options_up\"
shell-remote.sh --config ~/svn/svn-scripts/configs/smart.ini --machine compiler001,compiler002 \"svn up /usr/local/bin/ \$my_svn_options_up\"  
shell-remote.sh --config ~/svn/svn-scripts/configs/smart.ini  --machine \$machines_scm  \"svn up /usr/local/bin/ \$my_svn_options_up\"
shell-remote.sh --config ~/svn/svn-scripts/configs/smart.ini  --machine \$machines_scm  \"sudo chown root.root /usr/local/bin/sudo.shc\"
shell-remote.sh --config ~/svn/svn-scripts/configs/smart.ini  --machine \$machines_scm  \"sudo chmod +s /usr/local/bin/sudo.shc\"
"

echoTextBlue  "----------------网络常用命令-------------------"
echoTextGreen "ping 172.20.120.214
for i in \`seq 1 254\`; do echo \"ping 172.20.120.\$i -c 1 \"; ping 172.20.120.\$i -c 2 > /dev/null; echo \"arp -a 172.20.120.\$i\";arp -a 172.20.120.\$i; done
"

